Repository navigation
M6g: overlay presence (enter/exit motion, opaque boxes, scrim fade) and sheets; Style::motion (#107) - #164
Merged
Conversation
The overlay chain gains .shown, .transition, .exit_transition, .easing, .entrance and .on_exited. The library owns the Closed/Entering/Open/Exiting phase in Kept, on the retargetable Transition of transition.rs, so a reopen mid-exit reverses from where the box is. Children are not built while Closed. Motion is paint-only at draw time (opacity per shape, scale about the centre, slide by the box's own size); layout and hit rects are final from frame 1. An exiting overlay is inert but its blocker stays live; it is not judged by dismissal, takes no Esc/Return/Nav keys, and keeps its place in the stacking, the focus trap and the focus restore until it is gone. Style::motion (popover, menu, dialog, sheet) holds the defaults: instant neutral, shadcn values in the preset. Modal::Edge sheets slide by default. Motion::Presents lets the continuity checker accept the motion. Behaviour changes: the dialog example's dialog, confirmation and sheet animate; modal tests settle longer. `shown` is optional (no `shown` = declared means open, no motion). Motion::Presents is a new (non-exhaustive) variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
Both are always declared with shown(open), so they enter and leave with Style::motion.menu (shadcn: fade, zoom and a short slide, 150 ms). Tests that expect a closed list or menu to be gone settle for the exit first; the popup_style test keeps its LayoutState between frames, as presence needs. Submenus and the context menu still have no exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
Without group opacity (#40) a per-shape fade lets the page show through the box mid-motion, so only a modal's scrim fades. Fade, and the fade parts of Zoom, Pop and the old SlideFade, no longer touch the box's opacity; SlideFade is removed as the same as Slide. A Fade entrance has no motion of the box. Shown has no From<bool> (no naked bool arguments): the dialog example's state fields are Shown, and the stock select and menu map their open state explicitly. shown stays optional (a deviation from section 7, recorded). The shadcn timings are unchanged. Behaviour changes: the box is never translucent while entering or leaving; Entrance::SlideFade and Entry::SlideFade are gone; Shown::is_open added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
shadcn's overlays are bg-black/50, but they sit over a backdrop blur that eggshell does not have (#40); alone, 50% barely separated a dialog from the page, in dark mode especially. The user picked 80% from rendered candidates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
dialog, dialog_confirm, dialog_role_menu and sheet goldens change only by the darker scrim behind the box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M6 PR 6a: overlay presence (enter and exit motion) and sheets (#107).
docs/overlays.mdgains an As built in PR 6a section.API (overlay chain)
.shown(Shown)(Shown { Open, Closed }, with noFrom<bool>, per CLAUDE.md)..transition(Duration)and.exit_transition(Duration)..easing(..)and.ease_*()..entrance(Entrance):Zoom: scale from 95% about the centre;Pop:Zoomplus an 8 pt slide away from the anchor;Slide(side): by the box's own size;Fade: no box motion..on_exited(|app| ..): fires once, when the overlay is fully closed.Style::motion: MotionStyle { popover, menu, dialog, sheet }. The neutral preset is instant. The shadcn preset: popover and menuPop150 ms; dialogZoom200 ms; sheetSlide500 ms in, 300 ms out,InOut. These timings are approved on M6d: overlay presence (.shown/.transition/.entrance/.on_exited) and sheets #107.shownis optional (a recorded deviation from §7). Without it, an overlay is open while declared and has no motion, so existing overlays are unchanged. Motion methods used withoutshownpanic in debug builds.Behaviour
Kept::presences, built ontransition.rs's retargetableProgress, so there's no second clock. Reopening mid-exit reverses from the current progress.childrenisn't called.menumotion: the select list and dropdown menus. Submenus and context menus don't animate yet.Modal::Edgeslides from its edge by default. The dialog example's dialog, confirm and sheet animate.Motion::Presents), so it isn't a false "teleport".Behaviour changes to review
Entrance::SlideFadeis gone; it becameSlide.Motionis#[non_exhaustive].LayoutStaterecreated every frame never animates;popup_style.rsnow keeps its layout between frames.Tests and goldens
tests/it/presence.rs: 20+ tests covering:on_exitedfiring once;Plus unit tests in
src/presence.rs.Goldens: all 124 unchanged; settled states are unaffected.
Frame strips of each motion can be regenerated from ignored tests (
motion_strips_*).cargo xtask cipasses, including the golden check.Try it
The
dialogexample: open the dialog, the confirm and the sheet, and close them.🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up